package android.bignerdranch.a2_1;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class UC1Activity extends AppCompatActivity {

    public Button uc1_bt1;
    public Button uc1_bt2;
    public Button uc1_bt3;
    public Button uc1_bt4;
    public LinearLayout l1;
    public LinearLayout l2;
    public LinearLayout l3;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.uc1);

        uc1_bt1 = (Button)findViewById(R.id.btn_hor);
        uc1_bt2 = (Button)findViewById(R.id.btn_ver);
        uc1_bt3 = (Button)findViewById(R.id.btn_left);
        uc1_bt4 = (Button)findViewById(R.id.uc1_remake);
        l1 = (LinearLayout)findViewById(R.id.line1);
        LinearLayout linearLayout = new LinearLayout(this);

        uc1_bt1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                l1.setOrientation(LinearLayout.HORIZONTAL);
            }
        });

        uc1_bt2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                l1.setOrientation(LinearLayout.VERTICAL);
            }
        });

        uc1_bt3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                uc1_bt1.setLeft(1);
                uc1_bt2.setLeft(1);
                uc1_bt3.setLeft(1);
            }
        });

        uc1_bt4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(UC1Activity.this,MainActivity.class);
                startActivity(intent);
            }
        });
    }

}
